﻿<%@ page import="com.cai.dao.UtilsDao" %>
<%@ page import="com.cai.dao.impl.UtilsDaoImpl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    UtilsDao utilsDao = new UtilsDaoImpl();
    int studentCount = utilsDao.selectPersonCount("学生");
    int teacherCount = utilsDao.selectPersonCount("老师");
    int otherCount = utilsDao.selectPersonCount("其他人员");
    int itemSend = utilsDao.selectItemCount("借出");
    int itemReturn = utilsDao.selectItemCount("归还");
    int itemNum = utilsDao.selectItemCount("总数");
    int itemType_1 = utilsDao.selectItemType("电器");
    int itemType_2 = utilsDao.selectItemType("计量器具");
    int itemType_3 = utilsDao.selectItemType("其他器具");
    int itemType_4 = utilsDao.selectItemType("容器");
    request.setAttribute("studentCount", studentCount);
    request.setAttribute("teacherCount", teacherCount);
    request.setAttribute("otherCount", otherCount);
    request.setAttribute("itemSend", itemSend);
    request.setAttribute("itemReturn", itemReturn);
    request.setAttribute("itemNum", itemNum);
    request.setAttribute("itemType_1", itemType_1);
    request.setAttribute("itemType_2", itemType_2);
    request.setAttribute("itemType_3", itemType_3);
    request.setAttribute("itemType_4",itemType_4);
%>
<head>
    <title>高校器材管理中心</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="style/adminStyle.css" rel="stylesheet" type="text/css"/>
    <style>html, body {
        width: 100%;
        height: 100%;
    }</style>
    <script src="js/jquery.js"></script>
    <script src="js/public.js"></script>
</head>
<body>
<div class="wrap start-page">
    <h1><i class="home-icon"></i>高校器材管理中心</h1>
    <dl>
        <dt>实验器材统计</dt>
        <dd>
            <ul>
                <li>
                    <span>电器器材数量：</span>
                    <span>${requestScope.itemType_1}</span>
                </li>
                <li>
                    <span>计量器材数量：</span>
                    <span>${requestScope.itemType_2}</span>
                </li>
                <li>
                    <span>容器器材数量：</span>
                    <span>${requestScope.itemType_4}</span>
                </li>
            </ul>
            <ul>
                <li>
                    <span>其他器材数量：</span>
                    <span>${requestScope.itemType_3}</span>
                </li>
            </ul>
        </dd>
    </dl>

    <dl>
        <dt>用户借出归还信息</dt>
        <dd>
            <ul>
                <li>
                    <span>器材总数量：</span>
                    <span>${requestScope.itemNum}</span>
                </li>
                <li>
                    <span>借出数量：</span>
                    <span>${requestScope.itemSend}</span>
                </li>
                <li>
                    <span>归还数量：</span>
                    <span>${requestScope.itemReturn}</span>
                </li>
            </ul>
        </dd>
    </dl>

    <dl>
        <dt>用户信息统计</dt>
        <dd>
            <ul>
                <li>
                    <span>学生人员：</span>
                    <span>${requestScope.studentCount}</span>
                </li>
                <li>
                    <span>教师人员：</span>
                    <span>${requestScope.teacherCount}</span>
                </li>
                <li>
                    <span>其他人员：</span>
                    <span>${requestScope.otherCount}</span>
                </li>
            </ul>
        </dd>
    </dl>

    <dl>
        <dt>访问统计</dt>
        <dd>
            <ul>
                <li>
                    <span>今日访问：</span>
                    <span>1356</span>
                </li>
                <li>
                    <span>在线人数：</span>
                    <span>98</span>
                </li>
                <li>
                    <span>最新留言：</span>
                    <span>1</span>
                </li>
            </ul>
        </dd>
    </dl>
</div>
</body>
</html>